<template>
  <div ref="weapp"></div>
</template>

<script>
export default {
  name: "to-weapp",
  props: {
    path: {
      type: String,
      default: ''
    }
  },
  mounted() {
    this.$nextTick(()=>{
      let script = document.createElement('script')
      script.type = 'text/wxtag-template'
      script.text = `<div style="display:block;position: absolute;top: 0;left: 0;right: 0;bottom: 0;"></div>`
      let html = `<wx-open-launch-weapp style="display:block;position: absolute;top: 0;left: 0;right: 0;bottom: 0;" username="gh_b0987df2e0e1" path="${this.path}">${script.outerHTML}</wx-open-launch-weapp>`
      this.$refs.weapp.innerHTML = html;
    })
  }
}
</script>

<style scoped>

</style>